﻿<UserControl x:Class="nRoute.Samples.Netflix.Views.TitlesListingView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" 
	xmlns:n="http://nRoute/schemas/2010/xaml" 
	xmlns:local_Controls="clr-namespace:nRoute.Samples.Netflix.Controls" 
	xmlns:local_Behaviors="clr-namespace:nRoute.Samples.Netflix.Behaviors" 
    mc:Ignorable="d" n:Navigation.Title="{Binding PageTitle}"
    d:DesignHeight="600" d:DesignWidth="800">
	
	<i:Interaction.Behaviors>
		<n:BridgeViewModelBehavior/>
	</i:Interaction.Behaviors>
    
    <Grid x:Name="LayoutRoot" Background="White">
    	<Grid.RowDefinitions>
    		<RowDefinition/>
    		<RowDefinition Height="40"/>
    	</Grid.RowDefinitions>
		
		<ScrollViewer Padding="0" Margin="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled" 
				ScrollViewer.VerticalScrollBarVisibility="Auto" BorderBrush="{x:Null}" BorderThickness="0">
		
			<ItemsControl BorderThickness="0" Padding="0" ItemsSource="{Binding Titles}"
				ItemTemplate="{StaticResource TitleItemTemplate}" ItemsPanel="{StaticResource TitlesPanelTemplate}"/>
				
		</ScrollViewer>
		
    	<Border BorderBrush="#FFE0E0E0" CornerRadius="0" BorderThickness="0,1,0,0" Grid.Row="1">
    		<Border.Background>
    			<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    				<GradientStop Color="#FFCFD3DC" Offset="1"/>
    				<GradientStop Color="White" Offset="0.013"/>
    				<GradientStop Color="#FFEFEFF1" Offset="0.483"/>
    			</LinearGradientBrush>
    		</Border.Background>
    		<Grid>
    			
				<Border Width="40" HorizontalAlignment="Right" BorderBrush="#FF999898" BorderThickness="1,0,0,0" Cursor="Hand">
					<Border.Background>
						<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
							<GradientStop Color="#FF626262" Offset="0.905"/>
							<GradientStop Color="#FFC0BFBF"/>
						</LinearGradientBrush>
					</Border.Background>
					<i:Interaction.Triggers>
    					<i:EventTrigger EventName="MouseLeftButtonDown">
    						<n:ExecuteCommandAction Command="{Binding NextPageCommand}" ManageEnableState="True"/>
    					</i:EventTrigger>
    				</i:Interaction.Triggers>    				
    				<i:Interaction.Behaviors>
    					<n:BoolValueDisableBehavior Value="{Binding IsLoading}" />						
    				</i:Interaction.Behaviors>						
    				<TextBlock Text="4" FontFamily="Webdings" FontSize="24" Foreground="#FFE4E4E4" HorizontalAlignment="Center" 
    					VerticalAlignment="Center" Margin="5,0">    					
						<TextBlock.Effect>
							<DropShadowEffect ShadowDepth="2" BlurRadius="2" Color="#FF373535" Direction="-78"/>
						</TextBlock.Effect>		
					</TextBlock>
				</Border>
				
				<Border Width="40" HorizontalAlignment="Left" BorderBrush="#FF999898" BorderThickness="0,0,1,0" Cursor="Hand">
					<Border.Background>
						<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
							<GradientStop Color="#FF626262" Offset="0.905"/>
							<GradientStop Color="#FFC0BFBF"/>
						</LinearGradientBrush>
					</Border.Background>
					<i:Interaction.Triggers>
    					<i:EventTrigger EventName="MouseLeftButtonDown">
    						<n:ExecuteCommandAction Command="{Binding PreviousPageCommand}" ManageEnableState="True"/>
    					</i:EventTrigger>
    				</i:Interaction.Triggers>    				
    				<i:Interaction.Behaviors>
    					<n:BoolValueDisableBehavior Value="{Binding IsLoading}" />						
    				</i:Interaction.Behaviors>										
    				<TextBlock Text="3" FontFamily="Webdings" FontSize="24" Foreground="#FFE4E4E4" HorizontalAlignment="Center" 
    					VerticalAlignment="Center" Margin="5,0">    					
						<TextBlock.Effect>
							<DropShadowEffect ShadowDepth="2" BlurRadius="2" Color="#FF373535" Direction="-78"/>
						</TextBlock.Effect>		
					</TextBlock>
				</Border>
				
    			<!--<Border BorderThickness="1" BorderBrush="{StaticResource ButtonBorderBrush}"
    				Background="{StaticResource ButtonBkgBrush}" CornerRadius="4" HorizontalAlignment="Right" 
    				Cursor="Hand" VerticalAlignment="Center" Height="34" Margin="8,0">
    				<i:Interaction.Triggers>
    					<i:EventTrigger EventName="MouseLeftButtonDown">
    						<n:ExecuteCommandAction Command="{Binding NextPageCommand}" ManageEnableState="True"/>
    					</i:EventTrigger>
    				</i:Interaction.Triggers>    				
    				<i:Interaction.Behaviors>
    					<n:BoolValueDisableBehavior Value="{Binding IsLoading}" />						
    				</i:Interaction.Behaviors>										
    				<TextBlock Text="4" FontFamily="Webdings" FontSize="24" Foreground="White" HorizontalAlignment="Center" 
    					VerticalAlignment="Center" Margin="5,0" />
    			</Border>
    			<Border BorderThickness="1" BorderBrush="{StaticResource ButtonBorderBrush}"
    				Background="{StaticResource ButtonBkgBrush}" CornerRadius="4" HorizontalAlignment="Left" 
    				Cursor="Hand" VerticalAlignment="Center" Height="34" Margin="8,0">
    				<i:Interaction.Triggers>
    					<i:EventTrigger EventName="MouseLeftButtonDown">
    						<n:ExecuteCommandAction Command="{Binding PreviousPageCommand}" ManageEnableState="True"/>
    					</i:EventTrigger>
    				</i:Interaction.Triggers>    				
    				<i:Interaction.Behaviors>
    					<n:BoolValueDisableBehavior Value="{Binding IsLoading}" />						
    				</i:Interaction.Behaviors>										
    				<TextBlock Text="3" FontFamily="Webdings" FontSize="24" Foreground="White" HorizontalAlignment="Center" 
    					VerticalAlignment="Center" Margin="5,0" d:IsLocked="True" />
    			</Border>-->
				
				
				<TextBlock Text="{Binding CurrentPageIndex, StringFormat='Page {0}'}" Foreground="#FF85878B"
					TextOptions.TextHintingMode="Animated" HorizontalAlignment="Center" FontWeight="Bold" 
					VerticalAlignment="Center" Margin="0"  FontSize="18.667" FontFamily="Trebuchet MS" >
					<i:Interaction.Behaviors>
						<n:BoolValueVisibilityBehavior Value="{Binding IsLoading}" Negate="True"/>
					</i:Interaction.Behaviors>
					<TextBlock.Effect>
						<DropShadowEffect ShadowDepth="1" BlurRadius="2" Color="White" Direction="-247"/>
					</TextBlock.Effect>
				</TextBlock>
				
				<TextBlock Text="Loading, please hold.." Foreground="#FF85878B"
					TextOptions.TextHintingMode="Animated" HorizontalAlignment="Center" FontWeight="Bold" 
					VerticalAlignment="Center" Margin="0"  FontSize="16" FontFamily="Trebuchet MS" >
					<i:Interaction.Behaviors>
						<n:BoolValueVisibilityBehavior Value="{Binding IsLoading}"/>
					</i:Interaction.Behaviors>
					<TextBlock.Effect>
						<DropShadowEffect ShadowDepth="1" BlurRadius="2" Color="White" Direction="-247"/>
					</TextBlock.Effect>
				</TextBlock>
				
    		</Grid>
    	</Border>
		
		<local_Controls:WorkingIndicator IsWorking="{Binding IsLoading}"/>
		
	</Grid>
</UserControl>
